/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * AdminPage.java
 *
 * Created on 08/05/2014, 04:21:32 م
 */

package View;

//import Controller.Course;
//import Controller.Student;
import java.awt.Font;
import javax.swing.table.DefaultTableModel;
import javax.swing.table.TableColumn;

/**
 *
 * @author Ahmed
 */
public class AdminPage extends javax.swing.JFrame {
    private int[] doctorIds;
    private int[] studentIds;
    private int[] courseIds;
    private int[] semesterIds;
    private int[] taIds;
    /** Creates new form AdminPage */
    public AdminPage() {
        initComponents();
        setLocationRelativeTo(null);
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        jTabbedPane1 = new javax.swing.JTabbedPane();
        jLayeredPane1 = new javax.swing.JLayeredPane();
        jPanel2 = new javax.swing.JPanel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jLayeredPane5 = new javax.swing.JLayeredPane();
        jScrollPane1 = new javax.swing.JScrollPane();
        jTable1 = new javax.swing.JTable();
        jLayeredPane2 = new javax.swing.JLayeredPane();
        jPanel3 = new javax.swing.JPanel();
        jButton3 = new javax.swing.JButton();
        jButton4 = new javax.swing.JButton();
        jLayeredPane6 = new javax.swing.JLayeredPane();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTable2 = new javax.swing.JTable();
        jLayeredPane3 = new javax.swing.JLayeredPane();
        jPanel4 = new javax.swing.JPanel();
        jButton5 = new javax.swing.JButton();
        jButton6 = new javax.swing.JButton();
        jButton9 = new javax.swing.JButton();
        jLayeredPane7 = new javax.swing.JLayeredPane();
        jScrollPane3 = new javax.swing.JScrollPane();
        jTable3 = new javax.swing.JTable();
        jLayeredPane4 = new javax.swing.JLayeredPane();
        jPanel5 = new javax.swing.JPanel();
        jButton7 = new javax.swing.JButton();
        jButton8 = new javax.swing.JButton();
        jLayeredPane8 = new javax.swing.JLayeredPane();
        jScrollPane4 = new javax.swing.JScrollPane();
        jTable4 = new javax.swing.JTable();
        jLayeredPane9 = new javax.swing.JLayeredPane();
        jPanel7 = new javax.swing.JPanel();
        jButton10 = new javax.swing.JButton();
        jButton11 = new javax.swing.JButton();
        jLayeredPane10 = new javax.swing.JLayeredPane();
        jScrollPane5 = new javax.swing.JScrollPane();
        jTable5 = new javax.swing.JTable();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/Photos/banner.png"))); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jLabel1)
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );

        jButton1.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton1.setText("Add Doctor");
        jButton1.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton1MouseClicked(evt);
            }
        });

        jButton2.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton2.setText("View Doctors");
        jButton2.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton2MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel2Layout = new javax.swing.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addGroup(jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton2, javax.swing.GroupLayout.Alignment.LEADING))
                .addContainerGap(24, Short.MAX_VALUE))
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel2Layout.createSequentialGroup()
                .addGap(26, 26, 26)
                .addComponent(jButton1)
                .addGap(35, 35, 35)
                .addComponent(jButton2)
                .addContainerGap(173, Short.MAX_VALUE))
        );

        jPanel2.setBounds(0, 0, 160, 280);
        jLayeredPane1.add(jPanel2, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jScrollPane1.setBackground(new java.awt.Color(255, 255, 255));

        jTable1.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        jScrollPane1.setViewportView(jTable1);

        jScrollPane1.setBounds(0, 0, 580, 280);
        jLayeredPane5.add(jScrollPane1, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane5.setBounds(160, 0, 580, 280);
        jLayeredPane1.add(jLayeredPane5, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTabbedPane1.addTab("", new javax.swing.ImageIcon(getClass().getResource("/Photos/staff.png")), jLayeredPane1); // NOI18N

        jButton3.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton3.setText("Add Student");
        jButton3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton3MouseClicked(evt);
            }
        });

        jButton4.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton4.setText("View Students");
        jButton4.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton4MouseClicked(evt);
            }
        });

        javax.swing.GroupLayout jPanel3Layout = new javax.swing.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jButton3, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton4, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel3Layout.createSequentialGroup()
                .addGap(37, 37, 37)
                .addComponent(jButton3)
                .addGap(33, 33, 33)
                .addComponent(jButton4)
                .addContainerGap(164, Short.MAX_VALUE))
        );

        jPanel3.setBounds(0, 0, 170, 280);
        jLayeredPane2.add(jPanel3, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTable2.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {
                {},
                {},
                {},
                {}
            },
            new String [] {

            }
        ));
        jScrollPane2.setViewportView(jTable2);

        jScrollPane2.setBounds(0, 0, 570, 280);
        jLayeredPane6.add(jScrollPane2, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane6.setBounds(170, 0, 570, 280);
        jLayeredPane2.add(jLayeredPane6, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTabbedPane1.addTab("", new javax.swing.ImageIcon(getClass().getResource("/Photos/student.png")), jLayeredPane2); // NOI18N

        jButton5.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton5.setText("Add Course");
        jButton5.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton5MouseClicked(evt);
            }
        });

        jButton6.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton6.setText("View Courses");
        jButton6.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton6MouseClicked(evt);
            }
        });

        jButton9.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton9.setText("Update Course");

        javax.swing.GroupLayout jPanel4Layout = new javax.swing.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel4Layout.createSequentialGroup()
                .addGap(27, 27, 27)
                .addGroup(jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButton5, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE)
                    .addComponent(jButton9, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton6, javax.swing.GroupLayout.DEFAULT_SIZE, 123, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel4Layout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addComponent(jButton5)
                .addGap(31, 31, 31)
                .addComponent(jButton9)
                .addGap(27, 27, 27)
                .addComponent(jButton6)
                .addContainerGap(123, Short.MAX_VALUE))
        );

        jPanel4.setBounds(0, 0, 160, 280);
        jLayeredPane3.add(jPanel4, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jScrollPane3.setBackground(new java.awt.Color(255, 255, 255));

        jTable3.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        jScrollPane3.setViewportView(jTable3);

        jScrollPane3.setBounds(0, 0, 580, 280);
        jLayeredPane7.add(jScrollPane3, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane7.setBounds(160, 0, 580, 280);
        jLayeredPane3.add(jLayeredPane7, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTabbedPane1.addTab("", new javax.swing.ImageIcon(getClass().getResource("/Photos/courses.png")), jLayeredPane3); // NOI18N

        jLayeredPane4.setFont(new java.awt.Font("Tahoma", 1, 12));

        jButton7.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton7.setText("Add Semester");
        jButton7.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jButton7MouseClicked(evt);
            }
        });

        jButton8.setFont(new java.awt.Font("Tahoma", 1, 12));
        jButton8.setText("View Semesters");
        jButton8.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton8ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel5Layout = new javax.swing.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                    .addComponent(jButton7, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jButton8, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addContainerGap(31, Short.MAX_VALUE))
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel5Layout.createSequentialGroup()
                .addGap(21, 21, 21)
                .addComponent(jButton7)
                .addGap(37, 37, 37)
                .addComponent(jButton8)
                .addContainerGap(176, Short.MAX_VALUE))
        );

        jPanel5.setBounds(0, 0, 170, 280);
        jLayeredPane4.add(jPanel5, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTable4.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        jScrollPane4.setViewportView(jTable4);

        jScrollPane4.setBounds(0, 0, 570, 280);
        jLayeredPane8.add(jScrollPane4, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane8.setBounds(170, 0, 570, 280);
        jLayeredPane4.add(jLayeredPane8, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTabbedPane1.addTab("", new javax.swing.ImageIcon(getClass().getResource("/Photos/semester.png")), jLayeredPane4); // NOI18N

        jLayeredPane9.setBackground(new java.awt.Color(102, 102, 0));
        jLayeredPane9.setFont(new java.awt.Font("Tahoma", 1, 12));

        jButton10.setText("View all TAs");
        jButton10.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton10ActionPerformed(evt);
            }
        });

        jButton11.setFont(new java.awt.Font("Tahoma", 1, 12)); // NOI18N
        jButton11.setText("Add TA");
        jButton11.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButton11ActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanel7Layout = new javax.swing.GroupLayout(jPanel7);
        jPanel7.setLayout(jPanel7Layout);
        jPanel7Layout.setHorizontalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(20, 20, 20)
                .addGroup(jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING)
                    .addComponent(jButton11, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE)
                    .addComponent(jButton10, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 102, Short.MAX_VALUE))
                .addGap(48, 48, 48))
        );
        jPanel7Layout.setVerticalGroup(
            jPanel7Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel7Layout.createSequentialGroup()
                .addGap(36, 36, 36)
                .addComponent(jButton11)
                .addGap(18, 18, 18)
                .addComponent(jButton10)
                .addContainerGap(180, Short.MAX_VALUE))
        );

        jPanel7.setBounds(0, 0, 170, 280);
        jLayeredPane9.add(jPanel7, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jScrollPane5.setBackground(new java.awt.Color(255, 255, 255));

        jTable5.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {

            }
        ));
        jScrollPane5.setViewportView(jTable5);

        jScrollPane5.setBounds(0, 0, 570, 280);
        jLayeredPane10.add(jScrollPane5, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jLayeredPane10.setBounds(170, 0, 570, 280);
        jLayeredPane9.add(jLayeredPane10, javax.swing.JLayeredPane.DEFAULT_LAYER);

        jTabbedPane1.addTab("Teacher Assistant", jLayeredPane9);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
            .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 747, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, 120, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jTabbedPane1, javax.swing.GroupLayout.DEFAULT_SIZE, 320, Short.MAX_VALUE))
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jButton2MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton2MouseClicked
//        int columCount = 1;
//        Database doctorService = new Database();
//        try {
//            Doctor[] doctors = doctorService.selectAllDoctors();
//            //mapping id with primaryKey
//            doctorIds = new int[doctors.length];
//            for (int i = 0; i < doctorIds.length; i++) {
//                doctorIds[i] = (int) doctors[i].getId();
//            }
//            //
//            int doctorsAttributies = 3;
//            Object[][] doctorArr = new Object[doctors.length][doctorsAttributies];
//
//            for (int i = 0; i < doctors.length; i++) {
//                Object[] row = new Object[doctorsAttributies];
//                row[0] = columCount++;
//                row[1] = doctors[i].getFullname();
//                row[2] = doctors[i].getEmail();
//                doctorArr[i] = row;
//            }
//            jTable1.setModel(new DefaultTableModel(doctorArr, new String[]{"Id", "Full Name", "Email"}));
//            jTable1.setFont(new Font("tohma", Font.BOLD, 14));
//            //
//            TableColumn column = null;
//            for (int i = 0; i <= 5; i++) {
//                column = jTable1.getColumnModel().getColumn(i);
//                if (i == 4) {
//                    column.setPreferredWidth(200);
//                } else if (i == 0) {
//                    column.setPreferredWidth(5);
//                } else {
//                    column.setPreferredWidth(80);
//                }
//            }
//            //
//        } catch (Exception e) {
//        }

    }//GEN-LAST:event_jButton2MouseClicked

    private void jButton4MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton4MouseClicked
//        int columCount = 1;
//        Database studentsService = new Database();
//        try {
//            Student[] students = studentsService.selectAllStudents();
//            //mapping id with primaryKey
//            studentIds = new int[students.length];
//            for (int i = 0; i < studentIds.length; i++) {
//                studentIds[i] = (int) students[i].getId();
//            }
//            //
//            int studentsAttributies = 4;
//            Object[][] studentArr = new Object[students.length][studentsAttributies];
//
//            for (int i = 0; i < students.length; i++) {
//                Object[] row = new Object[studentsAttributies];
//                row[0] = columCount++;
//                row[1] = students[i].getFull_name();
//                row[2] = students[i].getEmail();
//                row[3] = students[i].getLevel();
//                studentArr[i] = row;
//            }
//            jTable2.setModel(new DefaultTableModel(studentArr, new String[]{"Id", "Full Name", "Email", "Level"}));
//            jTable2.setFont(new Font("tohma", Font.BOLD, 14));
//            //
//            TableColumn column = null;
//            for (int i = 0; i <= 5; i++) {
//                column = jTable2.getColumnModel().getColumn(i);
//                if (i == 4) {
//                    column.setPreferredWidth(200);
//                } else if (i == 0) {
//                    column.setPreferredWidth(5);
//                } else {
//                    column.setPreferredWidth(80);
//                }
//            }
//            //
//        } catch (Exception e) {
//        }

    }//GEN-LAST:event_jButton4MouseClicked

    private void jButton6MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton6MouseClicked
//        int columCount = 1;
//        Database courseService = new Database();
//        try {
//            Course[] courses = courseService.selectAllCourses();
//            //mapping id with primaryKey
//            courseIds = new int[courses.length];
//            for (int i = 0; i < courseIds.length; i++) {
//                courseIds[i] = (int) courses[i].getId();
//            }
//            //
//            int courseAttributies = 5;
//            Object[][] courseArr = new Object[courses.length][courseAttributies];
//
//            for (int i = 0; i < courses.length; i++) {
//                Object[] row = new Object[courseAttributies];
//                row[0] = columCount++;
//                row[1] = courses[i].getCourse_code();
//                row[2] = courses[i].getName();
//                row[3] = courses[i].getCourse_hours();
//                row[4] = courses[i].getType();
//                courseArr[i] = row;
//            }
//            jTable3.setModel(new DefaultTableModel(courseArr, new String[]{"Id", "Course code", "Course name", "Course hours","Type"}));
//            jTable3.setFont(new Font("tohma", Font.BOLD, 14));
//            //
//            TableColumn column = null;
//            for (int i = 0; i <= 5; i++) {
//                column = jTable3.getColumnModel().getColumn(i);
//                if (i == 4) {
//                    column.setPreferredWidth(100);
//                } else if (i == 0) {
//                    column.setPreferredWidth(5);
//                } else {
//                    column.setPreferredWidth(80);
//                }
//            }
//            //
//        } catch (Exception e) {
//        }
    }//GEN-LAST:event_jButton6MouseClicked

    private void jButton1MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton1MouseClicked
//        new AddDoctor().show();
//        this.setVisible(true);
   
    }//GEN-LAST:event_jButton1MouseClicked

    private void jButton7MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton7MouseClicked
       // new AddSemester().show();
        this.setVisible(true);

    }//GEN-LAST:event_jButton7MouseClicked

    private void jButton3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton3MouseClicked
        //new AddStudent().show();
        this.setVisible(true);
   
    }//GEN-LAST:event_jButton3MouseClicked

    private void jButton5MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jButton5MouseClicked
          // new AddCourse().show();
           this.setVisible(true);
    }//GEN-LAST:event_jButton5MouseClicked

    private void jButton10ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton10ActionPerformed
//        int columCount = 1;
//        Database tAssistantService = new Database();
//        try {
//            TA[] ta = tAssistantService.selectAllTA();
//            //mapping id with primaryKey
//            taIds = new int[ta.length];
//            for (int i = 0; i < taIds.length; i++) {
//                taIds[i] = (int) ta[i].getId();
//            }
//            //
//            int taAttributies = 3;
//            Object[][] taArr = new Object[ta.length][taAttributies];
//
//            for (int i = 0; i < ta.length; i++) {
//                Object[] row = new Object[taAttributies];
//                row[0] = columCount++;
//                row[1] = ta[i].getFullname();
//                row[2] = ta[i].getEmail();
//                taArr[i] = row;
//            }
//            jTable5.setModel(new DefaultTableModel(taArr, new String[]{"Id", "Full Name", "Email"}));
//            jTable5.setFont(new Font("tohma", Font.BOLD, 14));
//            //
//            TableColumn column = null;
//            for (int i = 0; i <= 5; i++) {
//                column = jTable5.getColumnModel().getColumn(i);
//                if (i == 4) {
//                    column.setPreferredWidth(200);
//                } else if (i == 0) {
//                    column.setPreferredWidth(5);
//                } else {
//                    column.setPreferredWidth(80);
//                }
//            }
//            //
//        } catch (Exception e) {
//        }


    }//GEN-LAST:event_jButton10ActionPerformed

    private void jButton8ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton8ActionPerformed
//        int columCount = 1;
//        Database semesterService = new Database();
//        try {
//            Semester[] semesters = semesterService.selectAllSemesters();
//            //mapping id with primaryKey
//            semesterIds = new int[semesters.length];
//            for (int i = 0; i < semesterIds.length; i++) {
//                semesterIds[i] = (int) semesters[i].getId();
//            }
//            //
//            int semesterAttributies = 2;
//            Object[][] semesterArr = new Object[semesters.length][semesterAttributies];
//
//            for (int i = 0; i < semesters.length; i++) {
//                Object[] row = new Object[semesterAttributies];
//                row[0] = columCount++;
//                row[1] = semesters[i].getSemester_name();
//                semesterArr[i] = row;
//            }
//            jTable4.setModel(new DefaultTableModel(semesterArr, new String[]{"Id", "Semester Name"}));
//            jTable4.setFont(new Font("tohma", Font.BOLD, 14));
//            //
//            TableColumn column = null;
//            for (int i = 0; i <= 5; i++) {
//                column = jTable4.getColumnModel().getColumn(i);
//                 if (i == 0) {
//                    column.setPreferredWidth(5);
//                } else {
//                    column.setPreferredWidth(80);
//                }
//            }
//            //
//        } catch (Exception e) {
//        }
    }//GEN-LAST:event_jButton8ActionPerformed

    private void jButton11ActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jButton11ActionPerformed
         // new AddTAssistant().show();
        this.setVisible(true);
    }//GEN-LAST:event_jButton11ActionPerformed

    /**
    * @param args the command line arguments
    */
   

    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton10;
    private javax.swing.JButton jButton11;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JButton jButton4;
    private javax.swing.JButton jButton5;
    private javax.swing.JButton jButton6;
    private javax.swing.JButton jButton7;
    private javax.swing.JButton jButton8;
    private javax.swing.JButton jButton9;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLayeredPane jLayeredPane1;
    private javax.swing.JLayeredPane jLayeredPane10;
    private javax.swing.JLayeredPane jLayeredPane2;
    private javax.swing.JLayeredPane jLayeredPane3;
    private javax.swing.JLayeredPane jLayeredPane4;
    private javax.swing.JLayeredPane jLayeredPane5;
    private javax.swing.JLayeredPane jLayeredPane6;
    private javax.swing.JLayeredPane jLayeredPane7;
    private javax.swing.JLayeredPane jLayeredPane8;
    private javax.swing.JLayeredPane jLayeredPane9;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JPanel jPanel7;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JTabbedPane jTabbedPane1;
    private javax.swing.JTable jTable1;
    private javax.swing.JTable jTable2;
    private javax.swing.JTable jTable3;
    private javax.swing.JTable jTable4;
    private javax.swing.JTable jTable5;
    // End of variables declaration//GEN-END:variables

}
